<?php
if ( !defined( 'BASEPATH' ) ) exit( 'No direct script access allowed' );
echo $header;
?>
<!-- postview -->
<div class="main postview">
    <?php if(isset($messageBox)){ ?>
        <?php echo $messageBox; ?>
    <?php }else{ ?>
    <ul class="infomation">
        <li><h3><?php echo $postData['title']; ?> <small><?php if($postData['ispersonal']){ ?>个人<?php }else{ ?>经纪<?php } ?>房源</small></h3></li>
        <li>在<strong><?php echo $postData['zonename']; ?></strong> <?php echo $postData['road']; ?> <strong><?php echo $postData['floor']; ?></strong>楼</li>
        <li><?php echo $postData['roomname']; ?></li>
        <li>居住面积 <?php echo $postData['square']; ?> m²</li>
        <?php if( $postData['type'] <= 2 ) { ?>
        <li>租金<strong><?php echo number_format($postData['amount'], 2, '.', ''); ?></strong>元 / 月</li>
        <?php } else { ?>
        <li>每平方售价 <strong><?php echo number_format($postData['amount'], 2, '.', ''); ?></strong> / m²</li>
        <li>总售价 <strong><?php echo number_format($postData['square'] * $postData['amount'] , 2, '.', ''); ?></strong> 元</li>
        <?php } ?>
        <li class="desciption">
            <div class="entry"><?php echo $postData['content']; ?></div>
        </li>
        <li class="posttime">
            最初发布于<small><?php echo my_dateformat($postData['addtime']); ?> <?php echo my_dateformat($postData['addtime'], 'Y/m/d H:i'); ?></small>
            更新时间<small><?php echo my_dateformat($postData['updatetime']); ?> <?php echo my_dateformat($postData['updatetime'], 'Y/m/d H:i'); ?></small>
        </li>
        <?php if($postImg){ ?>
        <li><h3>图片</h3></li>
        <li class="img">
            <img src="<?php echo base_url() . $postImg['path'] . $postImg['name']; ?>" />
        </li>
        <?php } ?>
    </ul>
    <div class="r">
        <div class="rbox contact">
            <h3>发布人</h3>
            <ul>
                <li class="username"><?php echo $postData['publisher']; ?></li>
                <li class="message"><a href="#comment_div">有兴趣？给我留言吧</a></li>
            </ul>
        </div>
        <?php if($relativeInfo){ ?>
        <div class="rbox relative">
            <h3>该地段的其他房源</h3>
            <ul>
                <?php foreach($relativeInfo as $single){ ?>
                <li>
                    <a href="<?php my_url('post', 'view', $single['id']); ?>"><?php echo $single['title']; ?><strong><?php echo number_format($single['amount'], 2, '.', ''); ?></strong></a>
                </li>
                <?php } ?>
            </ul>
        </div>
        <?php } ?>
    </div>
    <div class="c"></div>
    <?php echo $commentBox; ?>
    <?php } ?>
</div>
<!-- postview -->
<?php echo $footer; ?>